/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ru.ssau.model.storing;

import java.io.Serializable;
import java.util.Collection;
import java.util.Map;
import org.jdom.Element;
import ru.ssau.entities.User;
import ru.ssau.entities.Message;
import ru.ssau.lib.XMLizable;


public interface ForumDataAccessObject extends Serializable, XMLizable {
    void addThread(ru.ssau.entities.Thread thread) throws DataAccessException;
    void replaceThread(ru.ssau.entities.Thread thread) throws DataAccessException;
    ru.ssau.entities.Thread getThreadById(Integer id) throws DataAccessException;
    void deleteThreadById(Integer id) throws DataAccessException;
    Collection<ru.ssau.entities.Thread> getThreads() throws DataAccessException;
    Collection<ru.ssau.entities.Thread> findThreadsByCaption(String caption) throws DataAccessException;

    void addMessage(Message message) throws DataAccessException;
    void replaceMessage(Message message) throws DataAccessException;
    Message getMessageById(Integer id) throws DataAccessException;
    void deleteMessageById(Integer id) throws DataAccessException;
    Collection<Message> getMessages() throws DataAccessException;
    Collection<Message> findMessagesByText(String text) throws DataAccessException;

    void addUser(User user) throws DataAccessException;
    void replaceUser(User user) throws DataAccessException;
    User getUserById(Integer id) throws DataAccessException;
    void deleteUserById(Integer id) throws DataAccessException;
    Collection<User> getUsers() throws DataAccessException;
    Collection<User> findUsersByName(String name) throws DataAccessException;

    void closeStore() throws DataAccessException;
}
